<?php
error_reporting(E_ALL);
require "subject.php";
require "manager/manager.php";
require "manager/BusinessLeader.php";
require "manager/LatestLeader.php";
require "manager/ProductLeader.php";

$action = $_GET['act'] ?? 'create';
if (!empty($action)){
    switch ($action){
        case 'create'://创建文章
            $subject = new subject();
            $subject->content = "编辑保存文案";
            $subject->save();
            break;
        case 'step'://开始审批
            //这里最关键的是 1、确定第一个领导是谁 2、并维护各个领导之间的关系
            $busLeader = new BusinessLeader();//第一个领导
        $prodLeader = new ProductLeader();

        $lastLeader = new LatestLeader();

        //维护关系，该关系可存储到数据库中
        $busLeader->setLeader($lastLeader);
            $lastLeader->setLeader($prodLeader);

        $busLeader->step("审批通过");
            break;
    }
}